/**
 * 交易列表原型
 *
 * @Description:
 * @author tao.xie
 * @date 2019-02-25
 */
import TradeDetail from './TradeDetail.js'

export default class TradeItem {
  /**
   * 交易列表原型
   *
   * @param month
   * @param rechargeFee
   * @param payFee
   * @param refundFee
   * @param cashFee
   * @param tradeDetails
   */
  constructor (month, rechargeFee, payFee, refundFee, cashFee, tradeDetails) {
    this.month = month
    this.rechargeFee = rechargeFee
    this.payFee = payFee
    this.refundFee = refundFee
    this.cashFee = cashFee
    this.tradeDetails = []
    tradeDetails.map(detail => {
      this.tradeDetails.push(new TradeDetail(
        detail.TRADE_NO,
        detail.OUT_TRADE_NO,
        detail.TRADE_TYPE,
        detail.TRADE_DETAIL_TYPE,
        detail.LIST_PRICE,
        detail.PAY_FEE,
        detail.DISCOUNT,
        detail.TRADE_TIME,
        detail.PAY_TIME,
        detail.STATE,
        detail.RIDE_STATE,
        detail.ROUTE_NAME,
        detail.CARD_INSTANCE_ID,
        detail.CARD_INSTANCE_NAME,
        detail.CARD_TYPE_ID,
        detail.CARD_TYPE_NAME
      ))
    })
  }
  
}